home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / telecomm / stalk305.lzh / STKRMSGS.H < prev    next >
C/C++ Source or Header  |  1995-08-21  |  6KB  |  133 lines

  1. /*
  2.  *    stkrmsgs.h
  3.  *
  4.  *  This file defines the messages understood by STalker and the format
  5.  *  each should have.
  6.  *
  7.  *  Messages should be sent to STalker using the following sequence:
  8.  *
  9.  *  1   First, determine if STalker is present using the call:
  10.  *          stalker_id = appl_find("STALKER ");
  11.  *      If the id returned is -1, STalker is not present.
  12.  *
  13.  *  2   Send the appropriate message to STalker:
  14.  *          int     msg_buf[8];
  15.  *
  16.  *          msg_buf[0] = <message number>;
  17.  *          msg_buf[1] = <your appl id (gl_apid)>;
  18.  *          msg_buf[2] = # bytes in excess of the predefined 16 byte buf.
  19.  *          msg_buf[3..7] depends on the message;
  20.  *          appl_write(stalker_id, sizeof(msg_buf), (char *)msg_buf);
  21.  *
  22.  *  3   Wait for STalker to respond:
  23.  *          for (;;) {
  24.  *              evnt_mesag(msg_buf);
  25.  *              if (msg_buf[1] == stalker_id) {
  26.  *                  { check the response code & handle it }
  27.  *                  break;
  28.  *              } else {
  29.  *                  { handle system or other messages if necessary }
  30.  *              }
  31.  *          }
  32.  *
  33.  *  Copyright (C) Eric Rosenquist 1988.
  34.  *
  35.  */
  36.  
  37. typedef struct {
  38.     int junk[3];
  39.     char *address;
  40. } RESPONSE;
  41.  
  42. #define MSG_IDENTIFY    2000
  43.             /* No parameters.                                              */
  44.             /* Response in msg[0]: -2000                                   */
  45.             /* msg[3]: STalker version number                              */
  46.  
  47. #define MSG_SLEEP        2001
  48.             /* No parameters.                                              */
  49.             /* Response in msg[0]: -2001                                   */
  50.             /* Causes STalker to 'sleep'.  The same effect as the user     */
  51.             /* hitting ALT-K, but no message on the info line.             */
  52.  
  53. #define MSG_WAKE        2002
  54.             /* No parameters.                                              */
  55.             /* Response in msg[0]: -2002                                   */
  56.             /* The opposite of MSG_SLEEP.  Restore STalker to normal mode. */
  57.  
  58. #define MSG_DISPLAY        2003
  59.             /* Parameters in msg[3]: high word of string address           */
  60.             /* msg[4]: low word of string address                          */
  61.             /* ex.   (char *)&msg[3] = string_address;                     */
  62.             /* Response in msg[0]: -2003                                   */
  63.             /* Displays the null terminated string in the STalker terminal */
  64.             /* window.                                                     */
  65.  
  66. #define MSG_INFO        2004
  67.             /* Parameters in msg[3]: high word of string address           */
  68.             /* msg[4]: low word of string address                          */
  69.             /* ex.   (char *)&msg[3] = string_address;                     */
  70.             /* Response in msg[0]: -2004                                   */
  71.             /* Displays the null terminated string in the STalker terminal */
  72.             /* information line.                                           */
  73.  
  74. #define MSG_CONFIG        2005
  75.             /* No parameters.                                              */
  76.             /* Response in msg[0]: -2005                                   */
  77.             /* msg[3..4]: Pointer to STalker's CONFIG struct.              */
  78.             /* ex.  cfg = *((CONFIG **)&msg[3]);                           */
  79.             /* if (cfg->rs232.rs_flow) ...                                 */
  80.  
  81. #define MSG_BUFFER        2006
  82.             /* No parameters                                               */
  83.             /* Response in msg[0]: -2006                                   */
  84.             /* msg[3..4]: Pointer to STalker's file transfer               */
  85.             /* buffer.                                                     */
  86.             /* msg[5]: Size of buffer in K.                                */
  87.  
  88. #define MSG_RESOURCE    2007
  89.             /* No parameters                                               */
  90.             /* Response in msg[0]: -2007                                   */
  91.             /* msg[3..4]: Pointer to STalker's resource tree               */
  92.             /* as stored in global[5..6]                                   */
  93.  
  94. #define MSG_SENDSTRING    2008
  95.             /* Parameters in msg[3]: high word of string address           */
  96.             /* msg[4]: low word of string address                          */
  97.             /* ex.   (char *)&msg[3] = string_address;                     */
  98.             /* Response in msg[0]: -2008                                   */
  99.             /* Sends the null terminated string to the remote host via the */
  100.             /* serial port.                                                */
  101.  
  102. #define MSG_KEYSTROKE   2009
  103.             /* Parameters in msg[3]: keycode.                              */
  104.             /* msg[4]: shift keys                                          */
  105.  
  106. #define MSG_EXECUTE_SCRIPT    2010
  107.             /* Parameters in msg[3]: high word of address of file name     */
  108.             /* msg[4]: low word of address of file name                    */
  109.             /* ex.   (char *)&msg[3] = full_pathname;                      */
  110.             /* Response in msg[0]: -2010 if execution will be attempted,   */
  111.             /* 0 if STalker is busy and won't try.                         */
  112.             /* Executes the specified script file as long as STalker isn't */
  113.             /* busy doing something else (like downloading a file).        */
  114.             /* The filename should be fully-qualified in order to avoid    */
  115.             /* potential ambiguity.  The filename is not checked in any    */
  116.             /* way until STalker attempts to execute the script.           */
  117.  
  118. #define MSG_ENABLE    2011
  119.             /* Parameters in msg[3]: TRUE/FALSE -> Enable or Disable STalker 
  120.              * msg[4]: Serial port in question (BIOS dev #) Response
  121.              * in msg[0]: -2011 
  122.              * msg[3]: STalker's new enabled/disabled status 
  123.              * msg[4]: STalker's serial port bios dev #
  124.              * 
  125.              * If STalker is currently using the specified BIOS device number, 
  126.              * this message will make it enable or disable itself
  127.              * as if the user had typed Alt-K.  If STalker is using a different 
  128.              * port, this message has no effect (although STalker
  129.              * still replies). If STalker is unable to change the status 
  130.              * (because it is busy executing a command for example), the
  131.              * reply in msg[0] will be a zero.
  132.              */
  133.